package com.android.tiango.baba.view;



import android.widget.GridView;

public class MeasureGridView extends GridView {
	public MeasureGridView(android.content.Context context, android.util.AttributeSet attrs) {
		super(context, attrs);
		setChildrenDrawingOrderEnabled(true);
	}

	/**
	 * 设置不滚动
	 */
	public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
		super.onMeasure(widthMeasureSpec, expandSpec);

	}

	// private int position = 0;

//	@Override
//	protected void setChildrenDrawingOrderEnabled(boolean enabled) {
//		super.setChildrenDrawingOrderEnabled(enabled);
//	}

	// @Override
	// protected int getChildDrawingOrder(int childCount, int i) {
	// position = getSelectedItemPosition() - getFirstVisiblePosition();
	// if (position < 0) {
	// return i;
	// } else {
	// if (i == childCount - 1) {// 这是最后一个需要刷新的item
	// if (position > i) {
	// position = i;
	// }
	// return position;
	// }
	// if (i == position) {// 这是原本要在最后一个刷新的item
	// return childCount - 1;
	// }
	// }
	// return i;
	// }

}